<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<s:set name="listadocarrito" value="#session.listadocarrito" />
<s:set name="userName" value="#session.userName" />

<script src="../js/jquery.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/livevalidation.js"></script>
<script type="text/javascript">


$(document).ready( function() { $("#pagopaypal").submit();} ); 

/* function ver(){
	document.pagopaypal.action="PagoPaypalSave";
    document.pagopaypal.submit();	
	
}
 */


</script>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>paypal</title>
</head>
<body>
 <form name="pagopaypal" id="pagopaypal" action="<s:property value="url"/>" method="post">
		<input type="hidden" name="cmd" value="_cart">
		<input type="hidden" name="upload" value="1">
<!-- <input type="image" src="https://www.paypalobjects.com/es_ES/ES/i/btn/btn_paynowCC_LG.gif" border="0" name="submit" alt="PayPal. La forma rápida y segura de pagar en Internet.">  -->
		<input type="hidden" name="business" value="info@liwalo.com">
		<input type="hidden" name="image_url" value="http://liwalofront.bitbucket.org/maqueta/img/logo_150x50.png">
		
		
		<s:iterator value="listadocarrito" status="stat" >
			
			<input type="hidden" name="item_name_<s:property value="#stat.count" />" value="<s:property value="productoId.id" />. <s:property value="productoId.nombre" />">
			<input type="hidden" name="amount_<s:property value="#stat.count" />" value="<s:property value="productoId.precio" />">
			<input type="hidden" name="quantity_<s:property value="#stat.count" />" value="<s:property value="unidades" />">
		</s:iterator>

		
		<input type="hidden" name="shipping_1" value="8">
		<input type="hidden" name="shipping_2" value="0">
		<input type="hidden" name="shipping_3" value="0">
		
		<input type="hidden" name="rm" value="2">
		<input type="hidden" name="bn" value="LIWALO">
		<input type="hidden" name="custom" value="ok">
		<input type="hidden" name="currency_code" value="EUR">
		<input type="hidden" name="return" value="<s:property value="returnOk"/>">
		<input type="hidden" name="cancel_return" value="<s:property value="returnCancel"/>">
		<input type='hidden' name='lc' value='es'>
		
		<input type='hidden' name='first_name' value='<s:property value="user.nombre"/>'>  
		<input type='hidden' name='last_name' value='<s:property value="user.apellidos"/>'>  
		<input type='hidden' name='address1' value=' <s:property value="medios.tipoId.nombre"/> <s:property value="medios.direccion"/>'>  
		<input type='hidden' name='city' value='<s:property value="medios.listadoCiudadId.nombre"/>'>  
		<input type='hidden' name='zip' value='<s:property value="medios.cp"/>'>  
		<input type='hidden' name='night_phone_b' value='<s:property value="medios.telefono"/>'> 

<!-- <input type="button" name="x" value=" OK" onclick="javascript:ver()"> -->   
</form>


